load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@bazel_skylib//rules:build_test.bzl", "build_test")

# This target lays out the output needed from boringssl in the directory structure needed by the boring-sys build script.
copy_to_directory(
    name = "boringssl_gen_dir",
    srcs = [
        "@boringssl//:crypto",
        "@boringssl//:ssl",
    ],
    out = "boringssl_gen_dir_out",
    include_external_repositories = ["*"],
    replace_prefixes = {
        "libcrypto.a": "build/libcrypto.a",
        "libssl.a": "build/libssl.a",
    },
    visibility = ["//visibility:public"],
)

build_test(
    name = "build_test",
    targets = [
        "@complicated_dependencies//:boring",
        "@complicated_dependencies//:libz-ng-sys",
    ],
)
